/* $Id: Utils.java 39 2009-07-24 22:48:06Z h_m_r@gmx.de $ */
package org.jugger.tournament.gui.view;

import java.awt.Component;

import org.jugger.tournament.model.Team;
import org.jugger.tournament.model.Tournament;

public class Utils {

	public static boolean showEditTeamDialog(Component parent, Team team, Tournament tournament) {
		Team changedTeam = team;

		do {
			changedTeam = EditTeamDialog.showDialog(changedTeam, parent, parent);

			if (changedTeam != null && !tournament.hasTeam(changedTeam, team)) {
				team.copyValuesFrom(changedTeam);
				return true;
			}

		} while(changedTeam != null);

		return false;
	}

}
